import request from '@/config/axios'

// 环控器 VO
export interface EnvironmentalVO {
  id: number // id
  houseId: number // 农舍
  name: string // 设备名称
  description: string // 描述
  status: number // 状态
}

// 环控器 API
export const EnvironmentalApi = {
  // 查询环控器分页
  getEnvironmentalPage: async (params: any) => {
    return await request.get({ url: `/farm/environmental/page`, params })
  },

  // 查询环控器详情
  getEnvironmental: async (id: number) => {
    return await request.get({ url: `/farm/environmental/get?id=` + id })
  },

  // 新增环控器
  createEnvironmental: async (data: EnvironmentalVO) => {
    return await request.post({ url: `/farm/environmental/create`, data })
  },

  // 修改环控器
  updateEnvironmental: async (data: EnvironmentalVO) => {
    return await request.put({ url: `/farm/environmental/update`, data })
  },

  // 删除环控器
  deleteEnvironmental: async (id: number) => {
    return await request.delete({ url: `/farm/environmental/delete?id=` + id })
  },

  // 导出环控器 Excel
  exportEnvironmental: async (params) => {
    return await request.download({ url: `/farm/environmental/export-excel`, params })
  },
  // 农舍精简列表
  getSimpleHouseApi:async ()=>{
    return await request.get({
      url:`/farm/house/list-all-simple`,
    })
  },
}
